x11/gl: Do not specify the GLX context version
authorEmmanuele Bassi <ebassi@gnome.org>
Sat, 10 Jan 2015 00:07:51 +0000 (00:07 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Sat, 10 Jan 2015 00:07:51 +0000 (00:07 +0000)
commita834078804de592a9d77974b85ddfde03a86a94b
tree14db7cdbe531cf07340f299229da027098a80dd6
parent6384167054307ce7af249e40e47973d4761d97ab
x11/gl: Do not specify the GLX context version

If we use GDK_GL_PROFILE_3_2_CORE we are asking for a core profile
according to the GLX_ARB_create_context_profile extension. For that,
we pass the GLX_CONTEXT_CORE_PROFILE_BIT_ARB value for the
GLX_CONTEXT_PROFILE_MASK_ARB attribute.

The specification for the extension says that:

  If the requested OpenGL version is less than 3.2,
  GLX_CONTEXT_PROFILE_MASK_ARB is ignored and the functionality
  of the context is determined solely by the requested version.

Since we're asking for a core profile, we assume a GL version greater
than or equal to 3.2; thus, we don't need to specify the
GLX_CONTEXT_MAJOR_VERSION_ARB or the GLX_CONTEXT_MINOR_VERSION_ARB
attributes, and instead just rely on whatever version GLX gives us.

This seems to work around a strange issue in Mesa; if we ask for a core
profile and any version > 3.0, we get broken rendering on any shared
context we create.
gdk/x11/gdkglcontext-x11.c